<template>
  <div class="">
    标题：<input type="text" v-model="title" /> 发布人：<input
      type="text"
      v-model="user"
    />
    <button @click="add">添加</button>
  </div>
</template>

<script>
export default {
  data() {
    return {
      title: "",
      user: "",
    };
  },
  created() {},
  methods: {
    add() {
      this.$store.commit("add", { title: this.title, user: this.user });
    },
    //添加方法
  },
  components: {},
};
</script>

<style lang="scss"></style>
